home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Color;
-
- class SpreadSheetInput extends InputField {
- public SpreadSheetInput(String initValue, SpreadSheet app, int width, int height, Color bgColor, Color fgColor) {
- super(initValue, app, width, height, bgColor, fgColor);
- }
-
- public void selected() {
- switch (super.sval.charAt(0)) {
- case 'v':
- try {
- float f = Float.valueOf(super.sval.substring(1));
- ((SpreadSheet)super.app).setCurrentValue(f);
- return;
- } catch (NumberFormatException var2) {
- System.out.println("Not a float...");
- return;
- }
- case 'u':
- ((SpreadSheet)super.app).setCurrentValue(2, super.sval.substring(1));
- return;
- case 'l':
- ((SpreadSheet)super.app).setCurrentValue(1, super.sval.substring(1));
- return;
- case 'f':
- ((SpreadSheet)super.app).setCurrentValue(3, super.sval.substring(1));
- return;
- default:
- }
- }
- }
-